﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Sharp.Domain.PlatformBoundedContext.OrgModule.Aggregates;
using Sharp.Domain.Model;
using Sharp.Infrastructure;
using Sharp.Infrastructure.Interfaces;

namespace Sharp.Domain.PlatformBoundedContext.PersonModule.Aggregates
{
    /// <summary>
    /// 工作组
    /// </summary>
    public partial class Group : AggregateRoot, ITreeEntity, IStandardEntity
    {
        /// <summary>
        /// 组
        /// </summary>
        public Group()
        {
            People = new List<Person>();
            Orgs = new List<Org>();
        }

        /// <summary>
        /// 组织id
        /// </summary>
        public System.Guid? OrgId { get; set; }
        /// <summary>
        /// 编码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 组名
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 添加日期
        /// </summary>
        public System.DateTime? CheckInTime { get; set; }
        /// <summary>
        /// 录入员的id
        /// </summary>
        public Guid? CheckInUserId { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        public System.DateTime? ModifiTime { get; set; }
        /// <summary>
        /// 修改数据的用户Id
        /// </summary>
        public Guid? ModifiedUserId { get; set; }

        /// <summary>
        /// 父级
        /// </summary>
        public Guid? ParentId
        {
            get;
            set;
        }
        /// <summary>
        /// 排序
        /// </summary>
        public int OrderIndex
        {
            get;
            set;
        }
        /// <summary>
        /// 组织
        /// </summary>
        public virtual Org Org { get; set; }
        /// <summary>
        /// 组里面的员工
        /// </summary>
        public virtual ICollection<Person> People { get; set; }
        /// <summary>
        /// 组包含的组织
        /// </summary>
        public virtual ICollection<Org> Orgs { get; set; }
    }
}